package edu.gmu.messages;

import calendar.Type;

public class Resource implements edu.gmu.middleware.Message{
public Resource() { }
public int id;
public EndPoint endpoint;
public Type type;

public void marshal(edu.gmu.streams.BlockOutputStream stream) throws java.io.IOException{
    stream.writeInt(id);
    this.endpoint.marshal(stream);
    stream.writeInt( this.type.getId() );
}

public void unmarshal(edu.gmu.streams.BlockInputStream stream) throws java.io.IOException{
    this.id = stream.readInt();
    this.endpoint = new EndPoint();
    this.endpoint.unmarshal(stream);
    this.type = Type.get( stream.readInt() );
}
}
